package club.kingyin.kyblogprosearch.service;

import club.kingyin.commons.entity.core.Document;
import co.elastic.clients.elasticsearch._types.Result;

import java.io.IOException;
import java.util.List;
import java.util.Set;

public interface DocumentService {

    Result save(Document document);
    Result delete(String id) throws IOException;
    Result update(Document document);

    List<Document> searchUserTitle(String title, int userid);
    List<Document> searchAllTitle(String title);
    List<Document> searchAll(String context, int from, int size);
    List<Document> recommend(Document document);
    List<String> analyzer(String context);
    List<Document> searchTag(String tag, int from, int size);
    List<Document> searchClassify(String classify, int from, int size);
    List<Document> searchByIds(Set<String> ids);

    club.kingyin.commons.response.Result worldCloud(int userid) throws IOException;
    List<Document> moreViews(List<String> filter);
    List<Document> lastTimestamp(List<String> filter);
    List<Document> recommend(int userid, List<String> filter);
    List<Document> hotDocument(List<String> filter);
    List<Document> random(int n, List<String> filterIds) throws IOException;

    boolean hasDocument();

}
